<script lang="ts" setup name="flowableFormLeave">
import type { LeaveAuditors } from '@/index.d';
import FormData from './FormData.vue';
import ProcessInstanceTable from './ProcessInstanceTable.vue';
const props = defineProps({
  processInstanceId: String
});

const formData = ref();
const handleStartProcessInstance = () => {
  formData.value.handleSaveFormData?.();
};

const leaveAuditors = reactive<LeaveAuditors>({});
</script>
<template>
  <HqFlowableContainerForm @handle-start-process-instance="handleStartProcessInstance">
    <template #content="{ isEditable }">
      <FormData
        ref="formData"
        :process-instance-id="props.processInstanceId"
        :is-editable="isEditable"
        :leave-auditors="leaveAuditors"
      />
    </template>
    <template #table>
      <ProcessInstanceTable v-model:process-instance-auditors="leaveAuditors" />
    </template>
  </HqFlowableContainerForm>
</template>
<style lang="scss" scoped></style>
